package cn.sofwin.day0122.homework.account;

import java.util.Scanner;

public class AccountTest {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int money;
        System.out.println("******仙女银行******");
        System.out.print("请输入银行ID:");
        int id = sc.nextInt();

        Customer customer = new Customer("Jane","Smith");
        //Account account = new Account(id,2000,0.0123);
        //customer.setAccount(account);
        customer.setAccount(new Account(id,2000,0.0123));



        boolean tf = true;
        do {
            System.out.println("请选择服务：  1.存款  2.取款  0.退出");
            int choose = sc.nextInt();
            switch(choose){
                case 1:
                    System.out.print("请输入存款金额：");
                    money = sc.nextInt();
                    //account.deposit(money);
                    customer.getAccount().deposit(money);
                    break;
                case 2:
                    System.out.print("请输入取款金额：");
                    money = sc.nextInt();
                    //account.withdraw(money,customer);
                    customer.getAccount().withdraw(money,customer);
                    break;
                case 0:
                    tf = false;
                    System.out.println("谢谢使用，欢迎再次光临！");
                    break;
                default:
                    System.out.println("输入错误");
            }
        }while(tf);





    }
}
